﻿<Page x:Name="page"
    x:Class="Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.Views.Snapped.Category"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Microsoft.ALMRangers.VsarTreasureMap.WindowsStoreApp.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" Width="320">
    <Page.Resources>
        <DataTemplate x:Key="standardItemTemplate">
            <Border>
                <Grid Margin="0,0,0,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="50" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <Image Source="ms-appx:///Assets/TreasureMapImages/TreasureMapImages/TreasureChest_Empty.png" />
                    </Grid>
                    <Grid Grid.Column="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Row="0" Text="{Binding Name}" TextWrapping="Wrap" Style="{StaticResource GroupHeaderTextStyle}" />
                        <TextBlock Grid.Row="1" Text="{Binding ShortDescription}" TextWrapping="Wrap" Style="{StaticResource TitleTextStyle}"/>
                    </Grid>
                </Grid>
            </Border>
        </DataTemplate>
    </Page.Resources>

    <Grid Background="{StaticResource BackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="80"/>
            <RowDefinition Height="10"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="60"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button Command="{Binding GoBack}" Grid.Column="0" Style="{StaticResource BackButtonStyle}" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" />
            <TextBlock Grid.Column="1" VerticalAlignment="Center" Style="{StaticResource SubheaderTextStyle}" Text="{Binding CategoryTitle}" Margin="0" FontFamily="{StaticResource TitleFont}" Foreground="{StaticResource TitleBrush}" />
        </Grid>

        <ListView Margin="20,0,0,0" x:Name="projects" Grid.Row="2" ItemsSource="{Binding Projects}" HorizontalContentAlignment="Left" ItemTemplate="{StaticResource standardItemTemplate}" ItemContainerStyle="{StaticResource CategoryListViewItemStyle}" Tapped="ProjectsTapped" KeyUp="ProjectsKeyUp">
            <ListView.Header>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Image Grid.Column="0" Source="{Binding CategoryImage}" VerticalAlignment="Top" />
                    <TextBlock Grid.Row="1" Margin="10,10,10,10" Text="{Binding CategoryDescription}" TextWrapping="Wrap" Foreground="{StaticResource ContentForegroundBrush}" Style="{StaticResource TitleTextStyle}"/>
                </Grid>
            </ListView.Header>
        </ListView>
    </Grid>
</Page>